import React from 'react'
import { http, useHttp } from "../utils/http";
export let token=''
export const UnauthenticatedApp=()=>{
  let handleSubmit =async ()=>{
    let data={userName:'123456',password:'123456',verifyCode:'1234'}
   const data1 =await http('login',{
     data: data,
     method: 'get'
   })
    token=data1.data.token


  }
  let handleSubmitInfo=async ()=>{
    console.log(token);
    const data1 =await http('getUserInfo',{
      method: 'post',
      token
    })
  }
  return <div>
    <button onClick={()=>handleSubmit()}>登录</button>
    <button onClick={()=>handleSubmitInfo()}>获取好友列表</button>
  </div>
}
